﻿@model ListViewModel<CommonSearchValues, IQueryable<Recuper>>
@*@{ var tm = new WebUI.Models.aspnet_Users();}*@
@{ var tm = new WebUI.Models.Recuper();}
@{
    ViewBag.Title = "患者清单";
}
<div class="toolbox">
    <div id="searchbox">
        @using (Ajax.BeginForm("SentSmsImportRecuper", new { IsView = false }, new AjaxOptions { HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnFailure = "OnSiteError" }))
        {
            <div>
                随访单：&nbsp;&nbsp; @Html.DropDownListFor(m => m.SearchFrom.V1, new SelectList(ViewBag.Subjects, "ID", "Title"), "--全部--", null)
                随访类型：@Html.EditorFor(m => m.SearchFrom.V5)<br />
                主管医生：@Html.DropDownListFor(m => m.SearchFrom.V6, new SelectList(ViewBag.Users, "UserID", "UserName"), "全部")
                患者：@Html.EditorFor(m => m.SearchFrom.V0)<br />
                手术分类：@Html.EditorFor(m => m.SearchFrom.V2)
                诊断分类:@Html.EditorFor(m => m.SearchFrom.V3)<br />
                出院时间：@Html.EditorFor(m => m.SearchFrom.V4, "DateTimeStr")
                至：@Html.EditorFor(m => m.SearchTo.V4, "DateTimeStr") 
                <br />
                @Helpers.SubmitButton("查询", "qssubmit")
            </div>
        }
    </div>
</div>
@using (Ajax.BeginForm("SentSmsImportRecuper", new { IsView = false }, new AjaxOptions { HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "listview", InsertionMode = InsertionMode.InsertAfter, OnFailure = "OnSiteError" }))
{
    <div style="height:400px;overflow:auto;">
    <table class="width">
        <tr>
            <th>
            </th>
            <th>
                @Html.LabelFor(model => tm.User.UserName)
            </th>
            <th>
                @Html.LabelFor(model => tm.User.Gender)
            </th>
            <th>
                @Html.LabelFor(model => tm.BingAnHao)
            </th>
            <th>
                @Html.LabelFor(model => tm.User.MobileAlias)
            </th>
            <th>
                @Html.LabelFor(model => tm.DeHospDay)
            </th>
        </tr>
        @foreach (var item in Model.Data.OrderBy(v=>v.User.UserName).Take(50))
        {
            <tr>
                <td>
                    @Html.Hidden("SIDS", item.UserID)
                    @*@Html.CheckBox("Selection", false)*@
                    <input name="Selection" type="checkbox" value="@item.UserID" id="@item.UserID" />
                </td>
                <td>
                    @Html.DisplayFor(model => item.User.UserName)
                </td>
                <td>
                    @Html.DisplayFor(model => item.User.Gender)
                </td>
                <td>
                    @Html.DisplayFor(model => item.BingAnHao)
                </td>
                <td>
                    @Html.DisplayFor(model => item.User.MobileAlias)
                </td>
                <td>
                    @if (item.DeHospDay != DateTime.MinValue)
                    {
                        @Html.DisplayFor(model => item.DeHospDay)
                    }
                </td>
            </tr>
        }
    </table>
    @if (Model.Data.Count() > 50) { 
        <div class="error">*仅列出前50项项结果，可以请输入查询条件进一步精确查找。</div>
    }
    </div>
    @Helpers.SubmitButton("添加", "submit")
}
@Html.Partial("TrHilighter")